home *** CD-ROM | disk | FTP | other *** search
- September 15, 1988
- Dial CDEF version 1.0
-
- About the Dial CDEF sources...
-
- The Dial CDEF comes in two stuffit'd packages. One contains the LSC 3.0 source,
- the other a small sample application which uses the CDEF resource in its
- resource fork, and illustrates the standard ControlManager calls. If you
- click on the white-on-black title area at the bottom of the CDEF, you can
- drag the control around on the screen. (I didn't bother to include source
- for the sample application since it is so small, hope that's ok).
-
- I hacked the Dial CDEF together over a few days to see whether it was worth
- the trouble, after reading the artitle in MacTutor. As I stated in my posting,
- I really don't see any advantage in using CDEF's rather than a library, but I
- promptly got half a dozen letters asking me to post it anyway-- maybe other
- people can see advantages where I can't. Tell me if you do!
-
- CDEFs are poorly documented. After rolling the code into CDEF form I put a
- Debugger call just inside the entry point to see the order of messages and the
- value of param, and traced what routines got called. This clarified some
- things and left others murky. The biggest problem was that param contains
- a short int value with garbage in the high word on two calls, which was not
- documented. If you blithely test the whole long word for non-zero values, as
- I did at first, you almost always get a non-zero value and do the wrong thing.
-
- This is not guaranteed to be robust code. I made a minimal attempt to make sure
- things behave reasonably under low memory conditions, but have not tested it
- thoroughly (with heap scramble, low memory, etc). Use it as an example and be
- prepared to fix bugs.
-
- Also note that you may need to change the include statements in some files. My
- file organization has lots of utility source in a separate folder. Just edit
- accordingly. Other than that, to build the CDEF just link with MacTraps.
-
- The main thing missing in my opinion is no numbers on the dial itself. I wrote
- numbers into a dial-like library that I will use instead of a CDEF (among other
- things, I get to use floating point values this way) and it is pretty easy to
- do. All the floating point code is slow on a plus (I develop on a II) and even
- redrawing the dials to deactivate them on a II takes a noticable amount of time.
- I haven't bothered to speed things up. Besides these improvements, you can always
- add color too, but you will have to replace the offscreen drawing code.
-
- So here it is. I hope it's useful as an example, and perhaps you can find some
- real use for it. Enjoy!
-
- Doug Felt
- Courseware Authoring Tools Project
- Sweet Hall 3rd Floor
- Stanford University
- Stanford, CA 94305
- duggie@jessica.stanford.edu
-
-
- P.S. And you get my b/w offscreen drawing code (also not debugged) for free!
- What a deal!